package cn.edu.ctbu.api01.repository;

import cn.edu.ctbu.api01.domain.Student;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.domain.Specification;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

public interface StudentRepository extends JpaRepository<Student, Integer>{

    Page<Student> findByName(String name, Pageable pageable);
    Page<Student> findByNo(String no, Pageable pageable);
    Page<Student> findById(Integer id, Pageable pageable);

    /**
     * 找出所有的符号指定姓名和密码的学生
     * @param name 姓名
     * @param password 密码
     */
    public List<Student> findByNameAndPassword(String name, String password);

}
